/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ins.entity;

import java.util.List;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 检验报告书-数据表Entity
 * @author fanqinglong
 * @version 2017-11-21
 */
public class InsField extends DataEntity<InsField> {
	
	private static final long serialVersionUID = 1L;
	private InsTable table;		// 表id 父类
	private String name;		// 字段名称
	private String code;        // 模板导入中的占位符
	private String type;		// 字段类型 
	/*"1" 字符串
	"2" 数字
	"3" 年月日时分秒
	"4" 年月日
	"5" 年月*/
	private String preInput;    // 预录入 0：录入，1：选择(预录入),0:计算
	private String preValues;      // 静态值的取值集合
	private Integer sort = 10;		// 排序
	private String frequently;  // 是否是常用字段 0:否 1:是
	private String defaultValue; // 默认值
	private String required;    // 是否是必填字段
	private String indexed;     // 是否是索引字段
	private String uniquely;    // 是否是唯一字段
	private String numberFrom;  // 数值超始值
	private String numberTo;    // 数值结束值
	private String enableNumberRange;  // 是否启用数值范围
	private String digit;    // 小数位数
	public String getNumberFrom() {
		return numberFrom;
	}

	public void setNumberFrom(String numberFrom) {
		this.numberFrom = numberFrom;
	}

	public String getNumberTo() {
		return numberTo;
	}

	public void setNumberTo(String numberTo) {
		this.numberTo = numberTo;
	}

	public String getDigit() {
		return digit;
	}

	public void setDigit(String digit) {
		this.digit = digit;
	}

	private List<String> insValueList = Lists.newArrayList();     //静态值
	
	public InsField() {
		super();
	}

	public InsField(String id){
		super(id);
	}

	public InsField(InsTable table){
		this.table = table;
	}

	@Length(max=64, message="表id长度不能超过64")
	@JsonIgnore
	public InsTable getTable() {
		return table;
	}

	public void setTable(InsTable table) {
		this.table = table;
	}
	
	@Length(min=1, max=64, message="字段名称长度必须介于 1 和 64 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=1, max=2, message="字段类型长度必须介于 1 和 2 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getFrequently() {
		return frequently;
	}

	public void setFrequently(String frequently) {
		this.frequently = frequently;
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	public List<String> getInsValueList() {
		return insValueList;
	}

	public void setInsValueList(List<String> insValueList) {
		this.insValueList = insValueList;
	}

	public String getPreInput() {
		return preInput;
	}

	public void setPreInput(String preInput) {
		this.preInput = preInput;
	}

	public String getPreValues() {
		return preValues;
	}

	public void setPreValues(String preValues) {
		this.preValues = preValues;
	}

	public String getRequired() {
		return required;
	}

	public void setRequired(String required) {
		this.required = required;
	}

	public String getIndexed() {
		return indexed;
	}

	public void setIndexed(String indexed) {
		this.indexed = indexed;
	}

	public String getUniquely() {
		return uniquely;
	}

	public void setUniquely(String uniquely) {
		this.uniquely = uniquely;
	}

	public String getEnableNumberRange() {
		return enableNumberRange;
	}

	public void setEnableNumberRange(String enableNumberRange) {
		this.enableNumberRange = enableNumberRange;
	}
}